class XmlController < ApplicationController

  require 'xmlsimple'

  def generarxml
    @eventos=Evento.all


    s = render_to_string :file => 'xml/eventos.xml.builder'
    File.open('Eventos.xml','w'){|f| f.write s}

    flash[:notice] = 'Personas.xml generado!'
    redirect_to :controller => :eventos, :action=>:index
  end


  def generarymostrarxml
    @eventos=Evento.all


    s = render_to_string :file => 'xml/eventos.xml.builder'
    File.open('Eventos2.xml','w'){|f| f.write s}

    render 'xml/eventos.xml.builder'
  end
 
end
